# -*- coding:utf-8 -*-
# 2022/1/10 20:34
# author:xwl

from pydantic import BaseModel

class read_oilstim_result_model(BaseModel):
    data: list = [{
        'DvpUnit_Name': 'str',
        'StimType_Name': 'str',
        'Start_Year': 'str',
        'End_Year': 'str'
    }]

class read_oilstim_planproj_forecast_model(BaseModel):
    DvpUnit_Name: list = ['str']
    StimType_Name: list = ['str']
    Start_Year: str
    End_Year: str


class save_oilstim_result_model(BaseModel):
    add: list = [{
        'DvpUnit_Name': 'str',
        'StimType_Name': 'str',
        'Year': 'str',
        'Stim_WellNumber_Valid': 'int',
        'Stim_WellValidRatio': 'float',
        'Stim_ValidPeriod_Average': 'int',
        'Stim_IncreOil_Average': 'float'
    }]
    delete: list = [{
        'DvpUnit_Name': 'str',
        'StimType_Name': 'str',
        'Year': 'str'
    }]
    modify: list = [{
        'DvpUnit_Name': 'str',
        'StimType_Name': 'str',
        'Year': 'str',
        'Stim_WellNumber_Valid': 'int',
        'Stim_WellValidRatio': 'float',
        'Stim_ValidPeriod_Average': 'int',
        'Stim_IncreOil_Average': 'float'
    }]

class save_oilstim_planproj_forecast_model(BaseModel):
    delete: list = [{
        'DvpUnit_OilStim_PlanProj_Name': 'str',
        'DvpUnit_Name': 'str',
        'Year': 'str',
        'StimType_Name': 'str',
    }]
    add: list = [{
        'DvpUnit_OilStim_PlanProj_Name': 'str',
        'DvpUnit_Name': 'str',
        'Year': 'str',
        'StimType_Name': 'str',
        'Stim_WellValidRatio': 'int',
        'Stim_WellNumber_Valid': 'int',
        'Stim_ValidPeriod_Average': 'int',
        'Stim_IncreOil_Average': 'float',
        'Remark': 'str'
    }]
    modify: list = [{
        'DvpUnit_OilStim_PlanProj_Name': 'str',
        'DvpUnit_Name': 'str',
        'Year': 'str',
        'StimType_Name': 'str',
        'Stim_WellValidRatio': 'int',
        'Stim_WellNumber_Valid': 'int',
        'Stim_ValidPeriod_Average': 'int',
        'Stim_IncreOil_Average': 'float',
        'Remark': 'str'
    }]

class calculation_data(BaseModel):
    cal_data: list = [{
        'User_ID': 'str',
        'Proj_ID': 'str',
        'DvpUnit_Name': 'str',
        'Well_Name': 'str',
        'Stim_Date': '0000-00-00',
        'StimType_Name': 'str',
        'Stim_ValidPeriod': 'int',
        'Stim_IncreOil': 'float',
        'Stim_Cost': 'float',
        'Oil_CommodityRatio': 'float',
        'Oil_Price': 'float',
        'Oil_OprCost': 'float',
        'OilSale_TotalTaxRatio': 'float',
        'Money_Discount': 'float',
        'Remark': 'str'
    }]


class input_data(BaseModel):
    # xwl
    data: list = [{
        'Well_Name': 'str',
        'Stim_Date': 'str',
        'StimType_Name': 'str',
        'Stim_ValidPeriod': 'int',
        'Stim_IncreOil': 'float',
        'Stim_Cost': 'float',
        'Oil_CommodityRatio': 'float',
        'Oil_Price': 'float',
        'Oil_OprCost': 'float',
        'OilSale_TotalTaxRatio': 'float',
        'Money_Discount': 'float',
        'Remark': 'str',
    }]
    oilcost: list = [{
        "DvpUnit_Name": "String",
        "Year": "String",
        "Oil_OprCost": "double",
        "FuelCost": "double",
        "Power_Cost": "double",
        "FluidDispose_Cost": "double",
        "OilDisplaceAgent_Cost": "double",
        "NGLRecovery_Cost": "double",
        "Transp_Cost": "double",
        "WellTest_Cost": "double",
        "Other_Cost": "double",
        "Depre_Cost": "double",
        "Remark": "String"
    }]
    ratio: list = [{
        "DvpUnit_Name": "String",
        "Year": "String",
        "OilSale_TotalTaxRatio": "double",
        "AddedValue_TaxRatio": "double",
        "Resource_TaxRatio": "double",
        "EduAdd_TaxRatio": "double",
        "CityDvpAdd_TaxRate": "double",
        "Income_TaxRate": "double",
        "ManageCost_Ratio": "double",
        "Remark": "String"
    }]
    delete: list = [{
        'Well_Name': 'str',
        'Stim_Date': 'str',
        'StimType_Name': 'str'
    }]


class well_save_out_data(BaseModel):
    data: list = [{
        'Well_Name': "str",
        'Stim_Date': "2000-10-10",
        'StimType_Name': "测试1",
        'Stim_ValidPeriod': "int",
        'Stim_IncreOil': "float",
        'StimCost': "float",
        'StimOil_WellOprCost': "float",
        'StimOil_CommodityRatio': "float",
        'StimOil_Gross_SalesIncome': "float",
        'StimOil_Total_Tax': "float",
        'StimOil_Static_Gains': "float",
        'StimOil_NPV': "float",
        'StimOil_ROI': "float",
        'StimOil_NPVR': "float",
        'StimOil_FIRR': "float",
        'Stim_IncreOil_Critical': "float",
        'StimOil_Price_Critical': "float",
        'Oil_Price': "float",
        'OilSale_TotalTaxRatio': "float",
        'Money_Discount': "float",
        'Oil_OprCost': "float",
        'Remark': "str"
    }]


class dvp_cal_read(BaseModel):
    planproj_name: list = ["str"]
    dvpunit_name: list = ["str"]
    stimtype_name: list = ["str"]
    year: list = ["str"]


class eva_cal_save(BaseModel):
    datas: list = [{
        'DvpUnit_OilStim_PlanProj_Name': "str",
        'DvpUnit_Name': "str",
        'Year': "str",
        'StimType_Name': "str",
        'Forecast_Method': "str",
        'Stim_WellValidRatio': "float",
        'Stim_WellNumber_Valid': "float",
        'Stim_ValidPeriod_Average': "float",
        'Stim_IncreOil_Average': "float",
        'Update_Date': "str",
        'Stim_Cost': "float",
        'Oil_CommodityRatio': "float",
        'Oil_Price': "float",
        'Money_Discount': "float",
        'Remark': "str"
    }]
    oilcost: list = [{
        'DvpUnit_OilStim_PlanProj_Name': "str",
        "DvpUnit_Name": "String",
        "Year": "String",
        "Oil_OprCost": "double",
        "FuelCost": "double",
        "Power_Cost": "double",
        "FluidDispose_Cost": "double",
        "OilDisplaceAgent_Cost": "double",
        "NGLRecovery_Cost": "double",
        "Transp_Cost": "double",
        "WellTest_Cost": "double",
        "Other_Cost": "double",
        "Depreciation_Cost": "double",
        "Remark": "String"
    }]
    ratio: list = [{
        'DvpUnit_OilStim_PlanProj_Name': "str",
        "DvpUnit_Name": "String",
        "Year": "String",
        "OilSale_TotalTaxRatio": "double",
        "AddedValue_TaxRatio": "double",
        "Resource_TaxRatio": "double",
        "EduAdd_TaxRatio": "double",
        "CityDvpAdd_TaxRate": "double",
        "Income_TaxRate": "double",
        "ManageCost_Ratio": "double",
        "Remark": "String"
    }]
    delete: list = [{
        'DvpUnit_OilStim_PlanProj_Name':'str',
        'DvpUnit_Name': 'str',
        'Year': 'str',
        'StimType_Name': 'str'
    }]


class eva_cal_calculation(BaseModel):
    datas: list = [{
        'User_ID': 'str',
        'Proj_ID': 'str',
        'DvpUnit_OilStim_PlanProj_Name': "str",
        'DvpUnit_Name': "str",
        'Year': "str",
        'StimType_Name': "str",
        'Forecast_Method': "str",
        'Stim_WellValidRatio': "float",
        'Oil_OprCost': "float",
        'OilSale_TotalTaxRatio': 'float',
        'Stim_WellNumber_Valid': "float",
        'Stim_ValidPeriod_Average': "int",
        'Stim_IncreOil_Average': "float",
        'Update_Date': "str",
        'Stim_Cost': "float",
        'Oil_CommodityRatio': "float",
        'Oil_Price': "float",
        'Money_Discount': "float",
        "Remark": "String"
    }]


class eva_cal_out_save(BaseModel):
    datas: list = [{
        'DvpUnit_OilStim_PlanProj_Name': 'str',
        'DvpUnit_Name': 'str',
        'Year': 'str',
        'StimType_Name': 'str',
        'Stim_WellValidRatio': 'int',
        'Stim_WellNumber_Valid': 'int',
        'Stim_ValidPeriod_Average': 'int',
        'Stim_IncreOil_Average': 'float',
        'StimOil_CommodityRatio': 'float',
        'Oil_Price': 'float',
        'OilSale_TotalTaxRatio': 'float',
        'Money_Discount': 'float',
        'Oil_OprCost': 'float',
        'StimCost_Average': 'float',
        'StimOil_WellOprCost_Average': 'float',
        'StimOil_Total_Tax_Average': 'float',
        'StimOil_Gross_SalesIncome_Average': 'float',
        'StimOil_Static_Gains_Average': 'float',
        'StimOil_NPV_Average': 'float',
        'StimOil_ROI': 'float',
        'StimOil_NPVR': 'float',
        'StimOil_FIRR': 'float',
        'Stim_IncreOil_Critical_Average': 'float',
        'StimOil_Price_Critical': 'float',
        'Remark': 'str'
    }]
    delete: list = [{
        'DvpUnit_OilStim_PlanProj_Name': 'str',
        'DvpUnit_Name': 'str',
        'Year': 'str',
        'StimType_Name': 'str'
    }]


class input_data_recovery_save(BaseModel):
    User_ID: str
    Proj_ID: str
    Data: str
    Inputdata: str
    Outputdata: str


class return_data(BaseModel):
    User_ID: str
    Proj_ID: str


class projnamelist(BaseModel):
    Proj_ID: list = ['str']


class dvpnamelist(BaseModel):
    DvpUnit_Name: list = ['str']


class readdb_and_query_data(BaseModel):
    DvpUnit_OilStim_PlanProj_Name: list = ['str']
    Well_Name: list = ['str']
    StimType_Name: list = ['str']
    Year: list = ['str', 'str']


class well_cal_save_data(BaseModel):
    data: list = [{
        'DvpUnit_OilStim_PlanProj_Name': 'str',
        'Well_Name': 'str',
        'StimType_Name': 'str',
        'Year': 'year',
        'Forecast_Method': 'str',
        'Stim_ValidPeriod': 'int',
        'Stim_IncreOil': 'float',
        'Update_Date': 'date',
        'Stim_Cost': 'float',
        'Oil_CommodityRatio': 'float',
        'Oil_Price': 'float',
        'Money_Discount': 'float',
        'Remark': 'str'
    }]
    dvp_planproj_polprodcost: list=[{
        'DvpUnit_OilStim_PlanProj_Name':'str',
        'DvpUnit_Name':'str',
        'Year':'str',
        'Oil_OprCost':'float',
        'FuelCost':'float',
        'Power_Cost':'float',
        'FluidDispose_Cost':'float',
        'OilDisplaceAgent_Cost':'float',
        'NGLRecovery_Cost':'float',
        'Transp_Cost':'float',
        'WellTest_Cost':'float',
        'Other_Cost':'float',
        'Depreciation_Cost':'float',
        'Remark':'str'
    }]
    dvp_planproj_oilsalecost_ratio:list=[{
        'DvpUnit_OilStim_PlanProj_Name':'str',
        'DvpUnit_Name':'str',
        'Year':'str',
        'OilSale_TotalTaxRatio':'float',
        'AddedValue_TaxRatio':'float',
        'Resource_TaxRatio':'float',
        'EduAdd_TaxRatio':'float',
        'CityDvpAdd_TaxRate':'float',
        'Income_TaxRate':'float',
        'ManageCost_Ratio':'float',
        'Remark':'str'
    }]
    delete: list = [{
        'DvpUnit_OilStim_PlanProj_Name': 'str',
        'Well_Name': 'str',
        'Year': 'str',
        'StimType_Name': 'str'
    }]


class well_cal_cal_data(BaseModel):
    cal_data: list = [{
        'User_ID': 'str',
        'Proj_ID': 'str',
        'DvpUnit_OilStim_PlanProj_Name': 'str',
        'DvpUnit_Name': 'str',
        'Well_Name': 'str',
        'Year': '0000-00-00',
        'StimType_Name': 'str',
        'Stim_ValidPeriod': 'int',
        'Stim_IncreOil': 'float',
        'Stim_Cost': 'float',
        'Oil_CommodityRatio': 'float',
        'Oil_Price': 'float',
        'Oil_OprCost': 'float',
        'OilSale_TotalTaxRatio': 'float',
        'Money_Discount': 'float',
        'Remark': 'str'
    }]


class well_output_save_model(BaseModel):
    datas: list = [{
        'DvpUnit_OilStim_PlanProj_Name':'str',
        'Well_Name':'str',
        'Year':'str',
        'StimType_Name':'str',
        'Stim_ValidPeriod':'int',
        'Stim_IncreOil':'float',
        'StimOil_CommodityRatio':'float',
        'Oil_Price':'float',
        'OilSale_TotalTaxRatio':'float',
        'Money_Discount':'float',
        'Oil_OprCost':'float',
        'StimCost':'float',
        'StimOil_WellOprCost':'float',
        'StimOil_Total_Tax':'float',
        'StimOil_Gross_SalesIncome':'float',
        'StimOil_Static_Gains':'float',
        'StimOil_NPV':'float',
        'StimOil_ROI':'float',
        'StimOil_NPVR':'float',
        'StimOil_FIRR':'float',
        'Stim_IncreOil_Critical':'float',
        'StimOil_Price_Critical':'float',
        'Remark':'str',
    }]


class unit_scheme_curve_readdb(BaseModel):
    DvpUnit_Name: str
    StimType_Name: str
    Year: list = ["start_year", "end_year"]


class unit_scheme_curve_data_recovery_data(BaseModel):
    User_ID: str
    Proj_ID: str
    Data: str